import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import SequenceInput from '../src/components/custom/SequenceInput'
import ApprovalStateTag from '../src/components/custom/ApprovalStateTag'
import DictSelect from '../src/components/custom/DictSelect'
import DictTableColumn from '../src/components/custom/DictTableColumn'
import IconSelect from '../src/components/custom/IconSelect'
import MoneyFormat from '../src/components/custom/MoneyFormat'
import PositionStateTag from '../src/components/custom/PositionStateTag'
import ProduceStateTag from '../src/components/custom/ProduceStateTag'
import SaleOrderStateTag from '../src/components/custom/SaleOrderStateTag'
import MenuTypeTag from '../src/components/custom/MenuTypeTag'
import DownloadButton from '../src/components/custom/DownloadButton'
import CustomUpload from '../src/components/custom/CustomUpload'
import PriorityTag from './components/custom/PriorityTag'
import CustomerQuery from './components/query/CustomerQuery'
import CategoryQuery from './components/query/CategoryQuery'
import ProductQuery from './components/query/ProductQuery'
import MoldQuery from './components/query/MoldQuery'
import SupplierQuery from './components/query/SupplierQuery'
import ProduceSourceTypeTag from '../src/components/custom/ProduceSourceTypeTag'
import SaleOrderQuery from './components/query/SaleOrderQuery'
import EmployeeQuery from './components/query/EmployeeQuery'
import PaymentStateTag from '../src/components/custom/PaymentStateTag'
import StockInTypeTag from '../src/components/custom/StockInTypeTag'
import ShipmentStateTag from '../src/components/custom/ShipmentStateTag'
import OsOrderStateTag from '../src/components/custom/OsOrderStateTag'
import StockOperationTypeTag from '../src/components/custom/StockOperationTypeTag'
import '@/icons' // icon
import '@/permission' // permission control
import Moment from 'moment'
import global from './utils/websocket.js'
import VCharts from 'v-charts'

// 定义全局时间戳过滤器
Vue.filter('formatDateTime', function(value) {
  return Moment(value).format('YYYY-MM-DD HH:mm:ss')
})
Vue.filter('formatDate', function(value) {
  return Moment(value).format('YYYY-MM-DD')
})
Vue.config.productionTip = false
Vue.prototype.$global = global
// set ElementUI lang to EN
// large / medium / small / mini  table尺寸
/* Vue.use(ElementUI, { size: 'large' }) */
Vue.use(ElementUI)
Vue.use(VCharts)
/* import {
  Pagination,
  Dialog,
  Autocomplete,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Input,
  InputNumber,
  Radio,
  RadioGroup,
  RadioButton,
  Checkbox,
  CheckboxButton,
  CheckboxGroup,
  Switch,
  Select,
  Option,
  OptionGroup,
  Button,
  ButtonGroup,
  Table,
  TableColumn,
  DatePicker,
  TimeSelect,
  TimePicker,
  Popover,
  Tooltip,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Tabs,
  TabPane,
  Tag,
  Tree,
  Alert,
  Slider,
  Icon,
  Row,
  Col,
  Upload,
  Progress,
  Spinner,
  Badge,
  Card,
  Rate,
  Steps,
  Step,
  Carousel,
  CarouselItem,
  Collapse,
  CollapseItem,
  Cascader,
  ColorPicker,
  Transfer,
  Container,
  Header,
  Aside,
  Main,
  Footer,
  Timeline,
  TimelineItem,
  Link,
  Divider,
  Image,
  Calendar,
  Backtop,
  PageHeader,
  CascaderPanel,
  Loading,
  MessageBox,
  Message,
  Notification
} from 'element-ui' */

/* Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Autocomplete)
Vue.use(Dropdown)
Vue.use(DropdownMenu)
Vue.use(DropdownItem)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Input)
Vue.use(InputNumber)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(RadioButton)
Vue.use(Checkbox)
Vue.use(CheckboxButton)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(OptionGroup)
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(DatePicker)
Vue.use(TimeSelect)
Vue.use(TimePicker)
Vue.use(Popover)
Vue.use(Tooltip)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Alert)
Vue.use(Slider)
Vue.use(Icon)
Vue.use(Row)
Vue.use(Col)
Vue.use(Upload)
Vue.use(Progress)
Vue.use(Spinner)
Vue.use(Badge)
Vue.use(Card)
Vue.use(Rate)
Vue.use(Steps)
Vue.use(Step)
Vue.use(Carousel)
Vue.use(CarouselItem)
Vue.use(Collapse)
Vue.use(CollapseItem)
Vue.use(Cascader)
Vue.use(ColorPicker)
Vue.use(Transfer)
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)
Vue.use(Footer)
Vue.use(Timeline)
Vue.use(TimelineItem)
Vue.use(Link)
Vue.use(Divider)
Vue.use(Image)
Vue.use(Calendar)
Vue.use(Backtop)
Vue.use(PageHeader)
Vue.use(CascaderPanel)

Vue.prototype.$loading = Loading.service
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$notify = Notification
Vue.prototype.$message = Message */

Vue.prototype.$ELEMENT = { size: 'large', zIndex: 3000 }

Vue.use(SequenceInput)
Vue.use(ApprovalStateTag)
Vue.use(DictSelect)
Vue.use(DictTableColumn)
Vue.use(IconSelect)
Vue.use(MoneyFormat)
Vue.use(PositionStateTag)
Vue.use(ProduceStateTag)
Vue.use(SaleOrderStateTag)
Vue.use(MenuTypeTag)
Vue.use(DownloadButton)
Vue.use(CustomUpload)
Vue.use(PriorityTag)
Vue.use(CustomerQuery)
Vue.use(CategoryQuery)
Vue.use(ProductQuery)
Vue.use(MoldQuery)
Vue.use(SupplierQuery)
Vue.use(ProduceSourceTypeTag)
Vue.use(SaleOrderQuery)
Vue.use(EmployeeQuery)
Vue.use(PaymentStateTag)
Vue.use(StockInTypeTag)
Vue.use(ShipmentStateTag)
Vue.use(OsOrderStateTag)
Vue.use(StockOperationTypeTag)
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
